package com.lihua.project.system.chat.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.lihua.framework.aspectj.lang.annotation.Excel;
import com.lihua.framework.web.domain.BaseEntity;

/**
 * 聊天对象 chat
 * 
 * @author lihua
 * @date 2022-04-10
 */
public class Chat extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** chat聊天 */
    private Long id;

    /** 聊天编号，由两个userId组成（唯一确认一个聊天）一个聊天由两个用户组成【注意：值小的userId在前】 */
    @Excel(name = "聊天编号，由两个userId组成", readConverterExp = "唯=一确认一个聊天")
    private String chatId;

    /** 用户id */
    @Excel(name = "用户id")
    private Long userId;

    /** 用户名（为了减少查询） */
    @Excel(name = "用户名", readConverterExp = "为=了减少查询")
    private String userName;

    /** 用户头像 */
    @Excel(name = "用户头像")
    private String userAvatar;

    /** 消息 */
    @Excel(name = "消息")
    private String msg;

    /** 消息状态0未读、1已读 */
    @Excel(name = "消息状态0未读、1已读")
    private String msgState;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setChatId(String chatId)
    {
        this.chatId = chatId;
    }

    public String getChatId()
    {
        return chatId;
    }
    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }
    public void setUserName(String userName)
    {
        this.userName = userName;
    }

    public String getUserName()
    {
        return userName;
    }
    public void setUserAvatar(String userAvatar)
    {
        this.userAvatar = userAvatar;
    }

    public String getUserAvatar()
    {
        return userAvatar;
    }
    public void setMsg(String msg)
    {
        this.msg = msg;
    }

    public String getMsg()
    {
        return msg;
    }
    public void setMsgState(String msgState)
    {
        this.msgState = msgState;
    }

    public String getMsgState()
    {
        return msgState;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("chatId", getChatId())
            .append("userId", getUserId())
            .append("userName", getUserName())
            .append("userAvatar", getUserAvatar())
            .append("createTime", getCreateTime())
            .append("msg", getMsg())
            .append("msgState", getMsgState())
            .toString();
    }
}
